package com.atguigu.rabbit.producer;

import com.atguigu.rabbit.producer.entity.myCorrelationData;
import org.junit.jupiter.api.Test;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @BelongsProject: rabbitmq-parent-0528
 * @BelongsPackage: com.atguigu.rabbit.producer
 * @Author: jiangyi
 * @CreateTime: 2025-09-15  17:05
 * @Description: TODO
 * @Version: 1.0
 */
@SpringBootTest
public class correlationData02 {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void correlationDataDemo() {
        myCorrelationData correlationData = new myCorrelationData();
        correlationData.setId("123456789");
        correlationData.setMessage("confirm or return ?");
        Object str = "hello rabbitmq(simple_queue)...";
        rabbitTemplate.convertAndSend("direct_exchange","info",str,correlationData);
    }
}
